package com.IO.Stream;

import java.io.*;

/**
 * name：zhangwang
 * time：2025/3/12 11:15
 */
public class Writer {
    public static void main(String[] args) throws Exception {
        //创建字符输出转换为对象，转换留的本质是字符流
        OutputStreamWriter outputStreamWriter =
                new OutputStreamWriter(new FileOutputStream("a.txt"), "gbk");
        //写入数据
        outputStreamWriter.write("ahovbhoiaeshlibvaserhliknnb杨康");
        outputStreamWriter.flush();
        //释放资源
        outputStreamWriter.close();
    }
}
